/*****************************************
  NAME: led.c
  DESC: Led test
  WWW.YCTEK.COM
 *****************************************/
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h" 
#define ESC_KEY	0x1b
void dely(U32 tt)
{
   U32 i;
   for(;tt>0;tt--)
   {
     for(i=0;i<100000;i++){}
   }
}
   
void led(void)
{
   int delay_time = 10;
   Uart_Printf("Led Test Start Run!\n");
  
   while(Uart_GetKey()==0)
   {
	 rGPFDAT =  rGPFDAT & 0xffffffef;
	 rGPFDAT =  rGPFDAT | 0x000000e0;
     dely(delay_time);
	 rGPFDAT =  rGPFDAT & 0xffffffdf;
	 rGPFDAT =  rGPFDAT | 0x000000d0;
     dely(delay_time);
     rGPFDAT =  rGPFDAT & 0xffffffbf;
	 rGPFDAT =  rGPFDAT | 0x000000b0;
     dely(delay_time);
     rGPFDAT =  rGPFDAT & 0xffffff7f;
	 rGPFDAT =  rGPFDAT | 0x00000070;
     dely(delay_time);
     rGPFDAT =  rGPFDAT & 0xffffffbf;
	 rGPFDAT =  rGPFDAT | 0x000000b0;
     dely(delay_time);
	 rGPFDAT =  rGPFDAT & 0xffffffdf;
	 rGPFDAT =  rGPFDAT | 0x000000d0;
     dely(delay_time);
   }   
}
